--- @param extension Package
--- @param HY HY_Utility
--- @param U Utility
return function(extension, HY, U)
    local hy_kurokoma_saki = General:new(extension, "hy_kurokoma_saki", "chi_k", 5, 5, General.Female)
    local strength_speed = fk.CreateSkill {
        name = "strength_speed",
    }
    strength_speed:addEffect(fk.TargetConfirmed, {
        anim_type = "offensive",
        times = function(self, player)
            return 2 - player:getMark("strength_speed-turn")
        end,
        can_trigger = function(self, event, target, player, data)
            if not player:hasSkill(strength_speed.name) or player ~= target then
                return false
            end
            if #data:getAllTargets() ~= 1 or not (data.card and (data.card.trueName == "slash" or data.card.trueName == "duel")) then
                return false
            end
            if player:getMark("strength_speed-turn") >= 2 then
                return false
            end
            return data.from ~= player
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            local playerRecover = player:getMark("strength_speed") + 1
            local otherRecover = data.from:getMark("strength_speed") + 1
            room:loseHp(data.from, 1, strength_speed.name)
            room:loseHp(player, 1, strength_speed.name)
            room:setPlayerMark(player, "strength_speed", playerRecover)
            room:setPlayerMark(data.from, "strength_speed", otherRecover)
            room:addPlayerMark(player, "strength_speed-turn", 1)
        end,
    })
    strength_speed:addEffect(fk.TargetSpecified, {
        anim_type = "offensive",
        times = function(self, player)
            return 2 - player:getMark("strength_speed-turn")
        end,
        can_trigger = function(self, event, target, player, data)
            if not player:hasSkill(strength_speed.name) or player ~= target then
                return false
            end
            if #data:getAllTargets() ~= 1 or not (data.card and (data.card.trueName == "slash" or data.card.trueName == "duel")) then
                return false
            end
            if player:getMark("strength_speed-turn") >= 2 then
                return false
            end
            return data:getAllTargets()[1] ~= player
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            local to = data:getAllTargets()[1]
            local playerRecover = player:getMark("strength_speed") + 1
            local otherRecover = to:getMark("strength_speed") + 1
            room:loseHp(player, 1, strength_speed.name)
            room:loseHp(to, 1, strength_speed.name)
            room:setPlayerMark(player, "strength_speed", playerRecover)
            room:setPlayerMark(to, "strength_speed", otherRecover)
            room:addPlayerMark(player, "strength_speed-turn", 1)
        end,
    })
    strength_speed:addEffect(fk.TurnEnd, {
        can_trigger = function(self, event, target, player, data)
            return player:hasSkill(strength_speed.name) and table.any(player.room.alive_players, function(t)
                return t:getMark("strength_speed") > 0
            end)
        end,
        on_cost = Util.TrueFunc,
        on_use = function(self, event, target, player, data)
            local room = player.room
            for _, t in ipairs(room:getAlivePlayers()) do
                if t:isWounded() then
                    room:recover({
                        who = t,
                        num = t:getMark("strength_speed"),
                        skillName = strength_speed.name
                    })
                end
                room:setPlayerMark(t, "strength_speed", 0)
            end
        end
    })
    local black_horse = fk.CreateSkill {
        name = "black_horse",
    }
    black_horse:addEffect("targetmod", {
        bypass_times = function(self, player, skill, scope, card, to)
            return player:hasSkill(black_horse.name) and to and player.hp > to.hp
        end,
        bypass_distances = function(self, player, skill, card, to)
            return player:hasSkill(black_horse.name) and to and player.hp < to.hp
        end
    })
    extension:loadSkillSkels { strength_speed, black_horse }
    hy_kurokoma_saki:addSkill("strength_speed")
    hy_kurokoma_saki:addSkill("black_horse")
    Fk:loadTranslationTable {
        ["hy_kurokoma_saki"] = "骊驹早鬼",
        ["#hy_kurokoma_saki"] = "好斗之力首",
        ["illustrator:hy_kurokoma_saki"] = "INgarden.",
        ["designer:hy_kurokoma_saki"] = "黑曜人形",
        ["cv:hy_kurokoma_saki"] = "",

        ["strength_speed"] = "劲疾",
        [":strength_speed"] = "每回合限两次，在你的【杀】或【决斗】指定其他角色为唯一目标或你成为其他角色的【杀】或【决斗】的唯一目标后，你与其失去1点体力。每回合结束时，所有角色回复以此法失去的体力值。",

        ["black_horse"] = "黑驹",
        [":black_horse"] = "你对体力值小于/大于你的角色使用牌无次数/距离限制。",
    }
end
